
/* ogb 2-16-10
Bullet class */

#ifndef BULLET_H
#define BULLET_H

#include "SDL/SDL.h"
#include "mygrafx.h"
#include "Player.h"
#include "Enemy.h"
#include <list>

class Bullet
{
    private:
        int bullet_speed,
            bullet_slope,
            orgin_y;

        SDL_Rect bullet_loc;

        MyGrafx bullet_img;

        bool bullet_moving_right;

        char bullet_id;

    public:
        Bullet();
        Bullet( char bullet_id, int x, int y, bool facing_right );
        ~Bullet();

        void Move();
        void Draw();

        void Set_bullet_id( char bullet_id );
        char Get_bullet_id();

        bool Get_bullet_moving_right();

        SDL_Rect Get_bullet_loc();

};


class Bullets_control
{
    private:
        list< Bullet * > bullets_list;

        list< Bullet * >::iterator bullets_class_iter;

    private:
        void Check_bullets_off_screen();

    public:
        Bullets_control();
        ~Bullets_control();

        list< Bullet * >::iterator Remove_bullet( list< Bullet * >::iterator iter );

        void Add_bullet( Bullet *a_bullet );
        void Draw(Enemy_control &enemys, Player &player );
        void Free_list_from_memory();

        int Get_size_of_list();

        list< Bullet * >::iterator Get_bullets_control_iter();
        list< Bullet * >::iterator Get_bullets_control_end();
        list< Bullet * >::iterator Get_bullets_control_begin();
};
#endif
